package com.ler.yrmall.member.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ler.yrmall.basic.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Optional;

/**
 * @author Leron
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("ums_member_receive_address")
public class MemberReceiveAddressEntity extends BaseEntity<MemberReceiveAddressEntity> {

    /**
     * member_id
     */
    private Long memberId;

    /**
     *  收货人
     */
    private String name;

    /**
     * 联系电话
     */
    private String phone;

    /**
     * 邮编
     */
    private String postCode;

    /**
     * 省份
     */
    private String province;

    /**
     * 城市
     */
    private String city;

    /**
     * 区
     */
    private String region;

    /**
     * 详细地址
     */
    private String detailAddress;

    /**
     * 是否默认
     */
    private Boolean isDefault;

    public boolean isDefault() {
        return Optional.ofNullable(this.isDefault).orElse(false);
    }
}
